package com.rttmall.shopbackend.app.service;

import java.io.File;
import java.io.InputStream;
import java.util.List;

import com.aliyun.oss.model.OSSObject;
import com.aliyun.oss.model.SimplifiedObjectMeta;

public interface OssService {

	/**
	 * 关闭OSS连接
	 */
	public void shutDown();

	/**
	 * key是否存在
	 * 
	 * @param key
	 * @return
	 */
	public boolean isExist(String key);

	public void putObject(String key, InputStream inputStream);

	/**
	 * 上传byte[]到OSS
	 * 
	 * @param key
	 * @param bts
	 */
	public void putObject(String key, byte[] bts);

	/**
	 * 
	 * 上传文件到OSS
	 * 
	 * @param key
	 * @param file
	 * 
	 */
	public void putObject(String key, File file);

	/**
	 * 查询Object元数据
	 * 
	 * @param key
	 * @return
	 */
	public SimplifiedObjectMeta getMetadata(String key);

	/**
	 * 获取Object
	 * 
	 * @param key
	 * @return
	 */
	public OSSObject getObject(String key);

	/**
	 * 删除Object集合
	 * 
	 * @param keys
	 */
	public void deleteObjectList(List<String> keys);

	/**
	 * 创建文件夹
	 * 
	 * @param keySuffixWithSlash
	 */
	public void createFolder(String keySuffixWithSlash);

	/**
	 * 删除Object
	 * 
	 * @param key
	 */
	public void deleteObject(String key);

}
